﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Web.Configuration;


namespace DataAccess
{
    public class ConnectionToDataBase
    {
        static SqlConnection _con;


        public static SqlConnection StartConnection()
        {
            try
            {
                string strConnection = "Server=.;DataBase=Pharmacy; Integrated Security=SSPI;User ID=sa;Password=123;";
                _con = new SqlConnection(strConnection);
                return _con;
            }
            catch (Exception _epx)
            {
                throw _epx;
            }
        }

        public static SqlConnection CloseConnection()
        {
            _con.Close();
            return _con;
        }
        
    }
}
